//
//  NumberCell.swift
//  SkyApp
//
//  Created by 白翊 on 2021/12/30.
//

import UIKit

class NumberCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentView.addSubview(bgView)
        bgView.addSubview(numberLabel)
        
        bgView.snp.makeConstraints { make in
            make.edges.equalTo(0)
        }
        
        numberLabel.snp.makeConstraints { make in
            make.center.equalTo(bgView)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    var choosed: Bool = false {
        didSet {
            if choosed {
                bgView.backgroundColor = .detail
                numberLabel.textColor = .bg
            }else {
                bgView.backgroundColor = .light
                numberLabel.textColor = .detail
            }
        }
    }
    
    lazy var bgView = UIView()
    
    lazy var numberLabel: UILabel = {
        $0.font = .init(name: "Futura-Bold", size: 15)
        return $0
    }(UILabel())
}
